import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
        appBar: AppBar(title: const Text('你好Flutter')),
        //body内定义多个组件
        body: const Column(
          children: [
            MyText(),
          ],
        )),
  ));
}

class MyText extends StatelessWidget {
  const MyText({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 200,
      height: 200,
      alignment: Alignment.center,
      decoration: const BoxDecoration(
        color: Colors.yellow,
      ),
      child: const Text(
        """
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        你好,我是flutter!你好,我是flutter!
        """,
        textAlign: TextAlign.left,  //设置文字位置
        maxLines: 3,  //设置显示最多行数
        overflow: TextOverflow.ellipsis,  //设置文件溢出显示效果
        style: TextStyle(
          fontSize: 20,
          fontWeight: FontWeight.bold,  //设置加粗
          color: Colors.red,
          fontStyle: FontStyle.italic,   //设置斜体
          letterSpacing: 6,  //设置字间距
          decoration: TextDecoration.underline, //设置下划线
          decorationColor: Colors.blue,         //设置下划线颜色
          decorationStyle: TextDecorationStyle.dotted, //设置下划线样式
        ),
      ),
    );
  }
}
